﻿Public Class NhanVienDAO
    'Dim provider As New DataProvider()
    Dim connect As New connect()

    Public Function GetDaTa() As List(Of NhanVienDTO)
        Dim i As Integer
        Dim MaNV, TenDangNhap, MaLNV, BiXoa As String
        Dim NhanVienDTO As NhanVienDTO
        Dim NhanVienList As New List(Of NhanVienDTO)
        Dim dt As New DataTable
        dt = connect.GetData("select * from NHANVIEN")

        For i = 0 To dt.Rows.Count() - 1
            MaNV = dt.Rows(i)("MANV").ToString()
            TenDangNhap = dt.Rows(i)("TENDANGNHAP").ToString()
            MaLNV = dt.Rows(i)("MALNV").ToString()
            BiXoa = dt.Rows(i)("BIXOA").ToString()

            NhanVienDTO = New NhanVienDTO(MaNV, TenDangNhap, MaLNV, BiXoa)
            NhanVienList.Add(NhanVienDTO)
        Next
        Return NhanVienList
    End Function

End Class
